﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;
using System.Globalization;
using System.Windows.Media;

namespace ReporterControlLibrary.Converters
{
    [ValueConversion(typeof(MessageBoxImage), typeof(string))]
    public class IconTypeToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            var iconType = (MessageBoxImage)value;

            switch (iconType)
            {
                case MessageBoxImage.Warning: return "Images/109_AllAnnotations_Warning_48x48_72.png";
                case MessageBoxImage.Error: return "Images/109_AllAnnotations_Error_48x48_72.png";
                case MessageBoxImage.Information: return "Images/109_AllAnnotations_Info_48x48_72.png";
                case MessageBoxImage.Question: return "Images/109_AllAnnotations_Help_48x48_72.png";
            }

            return "";
        }

        public object ConvertBack(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
